package bma.common.langutil.log.acclog;

import java.util.concurrent.atomic.AtomicLong;

public abstract class AccessLogFactoryAbstract implements AccessLogFactory {

	protected AtomicLong id = new AtomicLong();
	protected char separator = ',';
	protected char separatorReplace = ',';

	public char getSeparator() {
		return separator;
	}

	public void setSeparator(char separator) {
		this.separator = separator;
	}

	public char getSeparatorReplace() {
		return separatorReplace;
	}

	public void setSeparatorReplace(char separatorReplace) {
		this.separatorReplace = separatorReplace;
	}

	public long nextId() {
		long v = id.incrementAndGet();
		if (v < 0) {
			id.compareAndSet(v, 0);
			return id.incrementAndGet();
		}
		return v;
	}

}
